import java.util.Scanner;


public class P5718 {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        int n = scanner.nextInt();
        int ans =1000;
        for (int i =1; i<=n;i++){
            int x= scanner.nextInt();
            if (x<ans){
                ans=x;
            }
        }
        System.out.println(ans);
    }
}